package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.domain.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserInfoMapper extends BaseMapper<UserInfo> {

    /**
     * 查询 黑名单用户信息
     *  需要 tb_user_info 和 tb_black_list两张变联合查询
     * 分页查询
     */
    @Select(value="SELECT * FROM tb_user_info info , tb_black_list black WHERE info.id = black.black_user_id AND black.user_id=#{userId}")
    IPage<UserInfo> findBlackList(Page<UserInfo> page, @Param("userId") Long userId);
}
